import tool from '@/utils/tool';

export function permission(data) {
	let permissions = tool.data.get("B_PERMISSIONS");
	if (!permissions) {
		return false;
	}
	let isHave = permissions.includes(data);
	return isHave;
}

export function rolePermission(data) {
	let userInfo = tool.data.get("B_USER_INFO");
	if (!userInfo) {
		return false;
	}
	let role = userInfo.permissions;
	if (!role) {
		return false;
	}
	let isHave = role.includes(data);
	return isHave;
}
